<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="PhotoAlbumTest.aspx.vb" Inherits="KDESolutions.Providers.UnitTests.PhotoAlbumTest"  MasterPageFile="~/Default.Master"  %>

  <asp:Content ID="Content1" ContentPlaceHolderID="LeftPane" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="CenterPane" runat="server">
    <div>
        <asp:TextBox ID="txtAlbumName" runat="server"></asp:TextBox>
        <asp:Button ID="btnAddAlbum" runat="server" Text="Add Album" /><br />
        			<asp:gridview id="GridView1" runat="server"
				datasourceid="ObjectDataSource1" datakeynames="AlbumID" cellpadding="6"
				autogeneratecolumns="False" BorderStyle="None" BorderWidth="0px" width="420px" showheader="False">
				<EmptyDataTemplate>
				You	currently have no albums.
				</EmptyDataTemplate>
				<EmptyDataRowStyle CssClass="emptydata"></EmptyDataRowStyle>
				<columns>
					<asp:TemplateField>
						<ItemStyle Width="116px" />
						<ItemTemplate>
							<table border="0" cellpadding="0" cellspacing="0" class="photo-frame">
								<tr>
									<td class="topx--"></td>
									<td class="top-x-"></td>
									<td class="top--x"></td>
								</tr>
								<tr>
									<td class="midx--"></td>
									<td><a href='Photos.aspx?AlbumID=<%# Eval("AlbumID") %>'>
										<img src="../Handler.ashx?AlbumID=<%# Eval("AlbumID") %>&Size=S" class="photo_198" style="border:4px solid white" alt="Sample Photo from Album <%# Server.HtmlEncode(Eval("Caption").ToString()) %>" /></a></td>
									<td class="mid--x"></td>
								</tr>
								<tr>
									<td class="botx--"></td>
									<td class="bot-x-"></td>
									<td class="bot--x"></td>
								</tr>
							</table>
						</ItemTemplate>
					</asp:TemplateField>
					<asp:TemplateField>
						<ItemStyle Width="280px" />
						<ItemTemplate>
							<div style="padding:8px;width:200px;">
								<b><%# Server.HtmlEncode(Eval("Caption").ToString()) %></b><br />
								<%# Eval("Count") %> Photo(s)<asp:Label ID="Label1" Runat="server" Text=" Public" Visible='<%# Eval("IsPublic") %>'></asp:Label>
							</div>
							<div style="width:200px;">
							    <%# Eval("UpdatedBy") %>
							</div>
							<div style="width:100%;text-align:right;">
							    <asp:LinkButton ID="lnkRename" runat="server" CommandName="Edit" Text="Edit" />
								<a href='Photos.aspx?AlbumID=<%# Eval("AlbumID")%>'>Edit Photos</a>
								<asp:LinkButton ID="ImageButton3" Runat="server" CommandName="Delete" Text="Delete" />
							</div>
						</ItemTemplate>
						<EditItemTemplate>
							<div style="padding:8px 0;">
								<asp:TextBox ID="TextBox2" Runat="server" Width="160" Text='<%# Bind("Caption") %>' CssClass="textfield" />
								<asp:CheckBox ID="CheckBox1" Runat="server" checked='<%# Bind("IsPublic") %>' text="Public" />
							</div>
							<div style="width:100%;text-align:right;">
							    <asp:LinkButton ID="lnkUpdate" runat="Server" CommandName="Update" Text="Update" />
							    <asp:LinkButton ID="lnkCancel" runat="Server" CommandName="Cancel" text="Cancel" />
							</div>
						</EditItemTemplate>
					</asp:TemplateField>
				</columns>
			</asp:gridview>
        <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" TypeName="KDESolutions.Providers.Images.ImageService"
		SelectMethod="GetAlbums" InsertMethod="AddAlbum" 
		DeleteMethod="RemoveAlbum" 
		UpdateMethod="EditAlbum" >
            <SelectParameters>
                <asp:Parameter DefaultValue="False" Name="PublicOnly" Type="Boolean" />
            </SelectParameters>
            <DeleteParameters>
                <asp:Parameter Name="AlbumID" Type="String" />
                <asp:Parameter Name="Username" Type="String" />
            </DeleteParameters>
            <UpdateParameters>
                <asp:Parameter Name="Caption" Type="String" />
                <asp:Parameter Name="IsPublic" Type="Boolean" />
                <asp:Parameter Name="AlbumID" Type="String" />
                <asp:Parameter DefaultValue="" Name="Username" Type="String" />
            </UpdateParameters>
            <InsertParameters>
                <asp:Parameter Name="Caption" Type="String" />
                <asp:Parameter Name="IsPublic" Type="Boolean" />
                <asp:Parameter Name="Username" Type="String" />
            </InsertParameters>
        </asp:ObjectDataSource>
        &nbsp;
        &nbsp;&nbsp;
    </div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="RightPane" runat="server">
</asp:Content>  

